eval(include("webbrowser.js"));
function include(path)
{
	var ForReading = 1;
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	var file = fso.OpenTextFile(path, ForReading);
	var code = file.ReadAll();

	file.Close();
	return code;
}

function alert(msg)
{
	WScript.Echo(msg);
}

function WM_OnQuit()
{
	WScript.Quit();
}

function WM_DocumentComplete()
{
	var url = handle.LocationURL;
}

function AlipayEncode()
{
	document.getElementById("PassEdit").SecurityMode = false;
	document.getElementById("PassEdit").TextValue = document.getElementById("edit").value;
	document.getElementById("PassEdit").SecurityMode = true;
	document.getElementById("edit").value = document.getElementById("PassEdit").TextValue;
}

function AlipayDecode()
{
	document.getElementById("PassEdit").SecurityMode = true;
	document.getElementById("PassEdit").TextValue = document.getElementById("edit").value;
	document.getElementById("PassEdit").SecurityMode = false;
	document.getElementById("edit").value = document.getElementById("PassEdit").TextValue;
}

function UIInit()
{
	var fso = WScript.CreateObject("Scripting.FileSystemObject");
	var path = fso.GetAbsolutePathName(".");
	this.document = GetDocument(handle, "file:///" + path + "/ui.htm");
}

/***************************************************************************************************/

InitHandle();
UIInit();
while (true)
{
	try
	{
		this.document.getElementById("btn").onclick = AlipayEncode;
		this.document.getElementById("btn2").onclick = AlipayDecode;
	}
	catch (e)
	{
		;
	}

	WScript.Sleep(1000);
}	
